package com.zhuiyun.project.api.dict.mapper;

import com.zhuiyun.project.api.dict.entity.DictData;
import com.zhuiyun.project.api.dict.model.DictDataModel;
import com.zhuiyun.project.common.mapper.BaseMapper;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.util.pageUtil.PageRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName DictDataMapper
 * @Description TODO
 * @Author Root
 * @Date 2023/6/23 9:17
 **/
@Mapper
public interface DictDataMapper extends BaseMapper<DictData> {
    @Select("select * from sys_dict_data where dict_id = #{dictId}")
    List<DictData> selectById(PageRequest pageRequest, Integer dictId);

    @Select("<script>  SELECT\n" +
            "\ta.* \n" +
            "FROM\n" +
            "\tsys_dict_data a\n" +
            "\tLEFT JOIN sys_dict_type b ON a.dict_id = b.dict_id\n" +
            "where a.dict_id = 4 and a.status=0 " +
            "</script>")
    List<DictData> selectDict(DictDataModel dictDataModel);


    /** 
     * 
     * @author 温
     * @date 2023/7/14 11:36
     * @parameter []
     * @return java.util.List<com.zhuiyun.project.api.dict.entity.DictData>
     */
    @Select("select* from sys_dict_data where dict_id=4 and status=0")
    List<DictData> selectOneById();
}
